package com.homework.ch06;

class Person {
    private String name;
    private Vehicle vehicle;
    /*public Person(String name) {
        this.name = name;
    }*/
    public Person(String name,Vehicle vehicle)
    {
        this.name=name;
        this.vehicle=vehicle;
    }
   /* public void driveToCompany(Vehicle vehicle) {
        *//*System.out.println(name + "准备去公司");
        vehicle.run();
        System.out.println(name + "到达公司");*//*

    }*/
    public void driveToCompany()
    {
        System.out.print(name+"驾驶");
       this.vehicle.run();
    }
}